<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        div {
            /* 开启flex布局 */
            display: flex;
            height: 300px;
            /* 从结尾开始排列 */
            /* align-items: flex-end; */
            /* 所有盒子整体在侧轴上居中 */
            /* align-items: center; */
            /* 沿侧轴线铺满，要求子盒子没有高度 */
            align-items: stretch;
            background-color: pink;
        }

        div span {
            /* 弹性盒子没有宽度，默认内容宽度--类似行内元素 */
            width: 100px;
            height: 100px;
            background-color: gray;
        }
        div span:nth-of-type(2){
            align-self: center;
        }
        div span:nth-of-type(3){
            align-self: flex-end;
        }
        div span:nth-of-type(4){
            align-self: center
        }
    </style>
</head>

<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <span>4</span>
        <span>5</span>
    </div>
</body>

</html>